//package com.ruoyi.app.controller.marketing.controller;
//
//import com.ruoyi.app.common.base.BaseAppController;
//import com.ruoyi.common.entity.VO.CouponVO;
//import com.ruoyi.app.controller.marketing.entity.MemberGetCouponVO;
//import com.ruoyi.app.controller.marketing.entity.ShowCouponVO;
//import com.ruoyi.app.controller.member.service.IMemberCouponService;
//import com.ruoyi.app.controller.marketing.service.ICouponService;
//import com.ruoyi.common.DO.common.coupon.CouponDO;
//import com.ruoyi.common.DO.common.member.MemberDO;
//import com.ruoyi.common.VO.CouponSearchVO;
//import com.ruoyi.common.annotation.AuthMember;
//import com.ruoyi.common.annotation.ParseShopId;
//import com.ruoyi.common.annotation.PassToken;
//import com.ruoyi.common.constant.CouponConstants;
//import com.ruoyi.common.core.domain.AjaxResult;
//import com.ruoyi.common.core.page.ResultData;
//import com.ruoyi.common.entity.DO.product.ProductSkuStockDO;
//import com.ruoyi.common.entity.VO.member.MemberVO;
//import com.ruoyi.common.entity.VO.product.ProductSearchVO;
//import com.ruoyi.common.entity.VO.product.ProductVO;
//import com.ruoyi.common.exception.BusinessException;
//import com.ruoyi.common.utils.DateUtils;
//import com.ruoyi.common.utils.ServletUtils;
//import com.ruoyi.common.utils.StringUtils;
//import io.swagger.annotations.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//import springfox.documentation.annotations.ApiIgnore;
//
//import java.util.List;
//import java.util.Map;
//
//
//@RestController
//@RequestMapping("/api/coupon")
//public class CouponController extends BaseAppController {
//
//    @Autowired
//    private ICouponService ICouponService;
//
//    @Autowired
//    private IMemberCouponService IMemberCouponService;
//
//    @ApiOperation(value = "获取优惠券详情", notes = "")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "appId", value = "小程序appID", required = true, paramType = "header"),
//            @ApiImplicitParam(name = "couponId", value = "优惠券ID", required = true, paramType = "query"),
//            @ApiImplicitParam(name = "code", value = "条形码编号", required = false, paramType = "query"),
//    })
//    @ApiResponses({
//            @ApiResponse(code = 200, message = ""),
//            @ApiResponse(code = 500, message = "登录超时！")
//    })
//    @PassToken
//    @GetMapping("/getDetail")
//    public AjaxResult getDetail(@ApiIgnore @ParseShopId Long shopId, @ApiIgnore @AuthMember MemberDO member) {
//        ProductSearchVO productSearchVO = new ProductSearchVO();
//        productSearchVO.setShopId(shopId);
//        productSearchVO.setIsDelete(0);
//        productSearchVO.setIsEnable(1);
//        ProductVO product;
//        if (StringUtils.isNotEmpty(ServletUtils.getParameter("productId"))) {
//            productSearchVO.setProductId(Long.parseLong(ServletUtils.getParameter("productId")));
//            product = productService.getDetail(productSearchVO);
//        } else if (StringUtils.isNotEmpty(ServletUtils.getParameter("code"))) {
//            productSearchVO.setProductSn(ServletUtils.getParameter("code"));
//            product = productService.getDetailByCode(productSearchVO);
//        } else {
//            return error("条形码缺失");
//        }
//        product.setIsAbleView(1);
//        if (product.getIsVip() != null && product.getIsVip() == 1) {
//            if (member.getId() == null || member.getId() == 0) {
//                product.setIsAbleView(0);
//            } else {
//                MemberVO memberInfo = memberService.getSimpleInfoById(member.getId());
//                if (memberInfo.getIsVip() == 0) {
//                    product.setIsAbleView(0);
//                }
//            }
//        }
//        List<ProductSkuStockDO> skuStockList = productService.searchSkuStockList(productSearchVO);
//        product.setSkuList(skuStockList);
//        return AjaxResult.success(product);
//    }
//
//
//    @ApiOperation(value = "优惠券详情", notes = "查询我的优惠券列表")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "token", value = "授权密钥", required = true, paramType = "header"),
//            @ApiImplicitParam(name = "useStatus", value = "使用状态", required = false, paramType = "query"),
//            @ApiImplicitParam(name = "start", value = "页码（不传默认1）", required = false, paramType = "query"),
//            @ApiImplicitParam(name = "limits", value = "每页条数（不传默认1000）", required = false, paramType = "query"),
//            @ApiImplicitParam(name = "orderBy", value = "排序", required = false, paramType = "query"),
//    })
//    @ApiResponses({
//            @ApiResponse(code = 200, message = ""),
//            @ApiResponse(code = 500, message = "登录超时！")
//    })
//    @PostMapping("/detail")
//    public AjaxResult list(@AuthMember MemberDO member) {
//        List<CouponVO> list = memberCouponService.searchList(member.getId(), couponSearchVO.getModelType());
//        return new AjaxResult(0, "查询成功", list);
//    }
//}
//
